<meta charset="utf-8">	
<?php 	 
	echo trim("       我叫   施君");//去掉良两边空格

	echo ltrim("      我   叫      ");//去除左边的空格

	echo "<hr />";

	$str = "This is a Teacher!\nthis is a Student";//再页面中无法换行
	echo $str;
	echo nl2br($str);

	$str1 = "<strong>你好美！</strong>" ;
	echo $str1;
	echo htmlentities($str1);//转义成<转成 &lt;

	echo "<hr />";
	$str2="<strong>她好美！</strong>" ;
	echo htmlspecialchars($str2);//中文字不会转换，只会转换特殊字符

	echo "<hr />";
	$str3="<strong>她们都好美！</strong>" ;
	echo strip_tags($str);//去除html标签

	echo "<hr />";
	$str4 = 'This is a Teacher.His is a "Lee",\n This is a sj';
	echo $str4;
	
	echo '<br />';
	// 转义
	echo addslashes($str4);//\转义

	echo '<br />';
	$a = addslashes($str4);//a就是写入数据库的，拿出来就有\
	echo $a;
	//解析\
	echo '<br />';
	echo stripcslashes($a);//解析转义的

	echo '<hr />';
	$str5 = "tHis a SJ";
	echo strtoupper($str5);//转换为大写
	echo '<br />';
	echo strtolower($str5);//小写
	echo '<br />';
	echo ucfirst($str5);//第一个大写
	echo '<br />';
	echo ucwords($str5);//每个单词首字母转化成大写

	echo '<hr />';
	//填充字符串函数
	$str6 = "Lee";
	echo str_pad($str6,10).'is a goods';//填充到网页里面看不到
	echo '<br />';
	echo str_pad($str6,10,'#');
	echo '<br />';
	echo str_pad($str6,10,'#',STR_PAD_RIGHT);
	echo '<br />';
	echo str_pad($str6,10,'#',STR_PAD_LEFT);

	 


?>